#include<bits/stdc++.h>
using namespace std;
int MOD = 997;
const int N = 70;
int S[N],sp;
int ans = 0;
int qpow(int x,int p){
	int res = 1;
	while(p){
		if(p & 1){
			res = 1ll*res*x%MOD;
		}
		x = 1ll*x*x%MOD;
		p >>= 1;
	}
	return res;
}
int jc[N];
int n;
int cnt = 0;
int tong[N];
int jc_1[N];
void dfs(int val){
	if(!val){
		int k = 0;
		for(int i = 1;i<=sp;i++){
			k += S[i]/2;
		}
		for(int i = 1;i <= sp;i++){
			for(int j = i + 1;j <= sp;j++){
				k += __gcd(S[i],S[j]);
			}
		}
		int res = jc[n];
		for(int i = 1;i<=sp;i++){
			res = 1ll*res*jc_1[S[i]]%MOD*jc[S[i] - 1]%MOD;
		}
		for(int i = 1;i<=n;i++){
			res = 1ll*res*jc_1[tong[i]]%MOD;
		}
		ans = (ans + 1ll*res*qpow(2,k)%MOD)%MOD;
		return;
	}
	for(int i = 1;i <= min(val,S[sp]);i++){
		S[++sp] = i;
		tong[i]++;
		dfs(val - i);
		tong[i]--;
		sp--;
	}
}
int main(){
	cin>>n;
	S[0] = n + 1;
	jc[0] = 1;
	jc_1[0] = 1;
	for(int i = 1;i<=n;i++){
		jc[i] = 1ll*jc[i - 1]*i%MOD;
		jc_1[i] = qpow(jc[i],MOD - 2);
	}
	dfs(n);
	ans = 1ll*ans*qpow(jc[n],MOD - 2)%MOD;
	cout<<ans<<'\n';
}